//
//  BaoxianCell.swift
//  旅航ios
//
//  Created by tulip on 2021/5/7.
//

import UIKit

class BaoxianCell: UITableViewCell {
    
    var propChoose:((Bool)->Void)?
    @IBOutlet weak var title: UIButton!
    @IBOutlet weak var btn: UIButton!
    @IBOutlet weak var headView: UIView!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        headView=gradientColor(colo1: "fff2e2", colo2: "fffdf6", view: headView,width: ScreenWidth-30) as! UIView
        self.backgroundColor=UIColor.clear
        self.selectionStyle = .none
        
        btn.setImage(UIImage(named: "保险-选中"), for: .selected)
        btn.isSelected=true
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
        self.selectionStyle = .none
    }
    
    
    @IBAction func click(_ sender: UIButton) {
        
        sender.isSelected = !sender.isSelected
        
        if sender.isSelected {
            if propChoose != nil {
                propChoose!(true)
            }
        }else{
            if propChoose != nil {
                propChoose!(false)
            }
        }
        
    }
    
}
